
import  axios  from '../utils/request'
 export async function getWorkStats(){
     const res=await axios.get('/echart/work')
     return res
 }
export async function hotProducts(){
    const res=await axios.get('/hotProduct')
    return res
}
 export async function shortProducts(){
    const res=await axios.get('/shortProduct')
    return res
 }

 export async function getProductDetail(id){
    const res=await axios.get('productInfo',{params:{id}})
    return res
 }
 export async function getProductList(pageNum:any){
    const res=await axios.get('productList',{params:{pageNum}})
    return res
 }
 export async function deleteP(id){
    const res=await axios.delete('deleteProduct',{params:{id}})
    return res
 }
 export async function updateProduct(product:any){
    const res=await axios.post('updateProduct',product)
    return res
 }

export async function addProduct(product:any){
    const res=await axios.post('addProduct',product)
    return res
}

export async function secKillProduct(id:any){
    const res=await axios.post(`secKill/${id}`)
    return res
}

export async function exportGoods(){
    const res=await axios.get('export', { responseType: 'blob' })
    return res
}

export async function updateProductStatus(id:any){
    const res=await axios.post(`updateProductStatus/${id}`)
    return res
}

export async function deleteBatchProduct(ids:any){
    const res=await axios.delete(`deleteBatch/${ids}`)
    return res
}
